﻿/*
 * Created by SharpDevelop.
 * User: Administrator
 * Date: 4/11/2011
 * Time: 11:53 PM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Net;
using System.Text;
using System.Web.Script.Serialization;
using HtmlAgilityPack;
using FileSystemDatabase;
using Newtonsoft.Json.Linq;
using TomatoSynchronizer.Entities;
using Newtonsoft.Json;
using System.IO;

namespace TomatoSynchronizer.Store
{
	/// <summary>
	/// Description of Store.
	/// </summary>
	public abstract class Store<T> : IStore<T>
	{
		internal Store()
		{
		}
		
		private Site _site;
		public Site site {
			get { return _site; }
			set { _site = value; }
		}
		
		public virtual void PersistItems(List<T> items)
		{
//			db.Write<List<T>>(items,_site.Name);
		}
		
		public virtual void PersistItem(T item)
		{
//			db.Write<T>(item,item.Id);
		}				
		
		public virtual void Truncate()
		{
//			db.Truncate();
		}				
		
		public virtual bool MoveItem(string itemId, string folderId)
		{
			throw new NotImplementedException();
		}
		
		public virtual bool DeleteItem(string itemId)
		{
			throw new NotImplementedException();
		}
		
		public virtual T[] LoadItems()
		{
			throw new NotImplementedException();
			
//			T[] items = db.Read<T>();
//			foreach(T item in items)
//			{
//				item.Store = this;
//			}
//			
//			return items;
		}
		
		public virtual T LoadItem(string itemId)
		{
			throw new NotImplementedException();
			
//			T item = db.Read<T>(itemId);
//			if(item != null)
//			{			
//				item.Store = this;
//				return item;
//			}
//			
//			return null;
		}
		
		public virtual bool Contains(T item)
		{
			throw new NotImplementedException();
		}
		
		public virtual List<T> GetItems()
		{
			throw new NotImplementedException();
		}
		
		public virtual T GetItem(string itemId)
		{
			throw new NotImplementedException();
		}
		
		public virtual bool UpdateItem(T item)
		{
			throw new NotImplementedException();
		}
		
		public virtual string InsertItem(T item)
		{
			throw new NotImplementedException();
		}
	}
}
